package com.wjw.cloud.controller;

import com.wjw.cloud.common.api.CommonResult;
import com.wjw.cloud.model.SysDict;
import com.wjw.cloud.service.SysDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 字典信息管理Controller
 */
@Controller
@Api(tags = "SysDictController", description = "字典信息管理")
@RequestMapping("/sysDict")
public class SysDictController {

    @Autowired
    private SysDictService sysDictService;


    @ApiOperation(value = "根据字典编码获取对应的字典列表")
    @RequestMapping(value = "/getInfoByType/{type}", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult getInfoByType(@PathVariable("type") String type) {
        List<SysDict> sysDictList = sysDictService.getInfoByType(type);
        return CommonResult.success(sysDictList);
    }


}
